package com.zhijian.medical.service;

import com.zhijian.medical.entity.po.PersonCommissionAuthorityForm;
import com.zhijian.medical.entity.vo.request.PersonCommissionAuthorityFormSearchVo;
import com.zhijian.medical.entity.vo.response.PersonCommissionAuthorityFormVo;
import com.zhijian.medical.util.Page;

import java.util.List;

/**
 * 人员-分级授权书表格 业务处理层
 *
 * @author HCG
 * @version 1.0
 * @date 2023-08-11 14:56:14
 */
public interface PersonCommissionAuthorityFormService {

    /**
     * 主键查询
     *
     * @param id
     * @return
     */
    PersonCommissionAuthorityForm selectById(Long id);

    /**
     * 根据人员ID查询
     *
     * @param personId
     * @return
     */
    PersonCommissionAuthorityForm selectByPersonId(Long personId);

    /**
     * 主键查询vo
     *
     * @param id
     * @return
     */
    PersonCommissionAuthorityFormVo selectVoById(Long id);

    /**
     * 按照主键删除
     *
     * @param id
     */
    void deleteById(Long id);

    /**
     * 新增
     *
     * @param personCommissionAuthorityForm
     * @return
     */
    Long insert(PersonCommissionAuthorityForm personCommissionAuthorityForm);

    /**
     * 保存or修改
     *
     * @param personCommissionAuthorityForm
     * @return
     */
    boolean saveOrUpdate(PersonCommissionAuthorityForm personCommissionAuthorityForm);

    /**
     * 更改
     *
     * @param personCommissionAuthorityForm
     * @return
     */
    boolean update(PersonCommissionAuthorityForm personCommissionAuthorityForm);

    /**
     * 动态修改
     *
     * @param record
     * @return
     */
    boolean updateByPrimaryKeySelective(PersonCommissionAuthorityForm record);

    /**
     * 总数
     *
     * @param personCommissionAuthorityFormSearchVo
     * @return
     */
    Integer count(PersonCommissionAuthorityFormSearchVo personCommissionAuthorityFormSearchVo);

    /**
     * 列表
     *
     * @param personCommissionAuthorityFormSearchVo
     * @return
     */
    List<PersonCommissionAuthorityFormVo> selectList(PersonCommissionAuthorityFormSearchVo personCommissionAuthorityFormSearchVo);

    /**
     * 分页查询
     *
     * @param personCommissionAuthorityFormSearchVo
     * @return
     */
    Page<PersonCommissionAuthorityFormVo> selectPage(PersonCommissionAuthorityFormSearchVo personCommissionAuthorityFormSearchVo);

    /**
     * 批量新增数据（MyBatis原生foreach方法）
     *
     * @param entities 实例对象列表
     * @return 影响行数
     */
    boolean insertBatch(List<PersonCommissionAuthorityForm> entities);

    /**
     * 查询出最新数据的code
     *
     * @return
     */
    String selectMaxCode();

    /**
     * 生成下一个编码
     *
     * @return
     */
    String createNextCode();
}